
#include <ftp.h>
#include <iostream>

using std::cout;
using std::endl;

int main(int argc, char *argv[]){

//Create FTP Client    
    FTPClient ftp;

//Connect with server    
    if (ftp.connect("My_FTP_Server",21,"user","password"))
        cout << "Connected to FTP server" << endl;
    else
        cout << "connection Failed" << endl;

//Upload from Windows       
    if (ftp.UploadFile("C:\\test.txt","test.txt"))
        cout << "File transfered" << endl;
    else
        cout << "File send not possible" << endl;
        
//Upload from Unix        
    if (ftp.UploadFile("home/user/Desktop/test.txt","test.txt"))
        cout << "File transfered" << endl;
    else
        cout << "File send not possible" << endl;

//Download from Windows        
    if (ftp.DownloadFile("test.txt","C:\\file.txt")
        cout << "File downloaded" << endl;
    else
        cout << "Download failed" << endl;
        
//Download from Unix       
    if (ftp.DownloadFile("test.txt","home/user/Desktop/file.txt")
        cout << "File downloaded" << endl;
    else
        cout << "Download failed" << endl;
    
    return 0;    
}
